/**
 * 
 */
package org.codesmell.util.rendermap.js;

import org.codesmell.util.rendermap.TypeConverter;
import org.codesmell.util.rendermap.local.Assert;

public class Pixel implements TypeConverter
{

    private static final long serialVersionUID = 1L;

    @Override
    public Object convert(final Object value)
    {
        Assert.parametersNotNull("value", value);
        if (value instanceof Number)
        {
            final Number n = (Number) value;
            return n.toString() + "px";
        }
        throw new IllegalArgumentException("Cannot render non-numbers to pixels");

    }

}